-
Notifications
You must be signed in to change notification settings - Fork 5
PROD - Auth0 security and token updates #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| user_id?: string; | ||
| userId?: string; | ||
| USER_ID?: string; | ||
| password?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[❗❗ security]
Storing passwords as plain text is a security risk. Consider hashing passwords before storing them in the database.
| for (let i = 0; i < records.length; i += chunkSize) { | ||
| const chunk = records.slice(i, i + chunkSize); | ||
| const loginIds = chunk.map((record) => new Prisma.Decimal(record.loginId)); | ||
| const existing = await prisma.security_user.findMany({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[💡 performance]
Using Prisma.Decimal for loginId conversion may not be necessary if loginId is always a string. Ensure that loginId is consistently a string to avoid unnecessary conversions.
| })); | ||
|
|
||
| const result = await prisma.security_user.createMany({ | ||
| data, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[correctness]
The skipDuplicates option in createMany may not work as expected if the database does not have a unique constraint on the fields being inserted. Ensure that the database schema enforces uniqueness where necessary.
| credential.access_token, | ||
| cookieOptions, | ||
| ); | ||
| const userId = this.extractUserIdFromToken(credential.access_token); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[❗❗ correctness]
The removal of the tcV3JwtCookieName cookie setting could impact functionality if this cookie is still required elsewhere in the application. Ensure that this change is intentional and that no other parts of the system depend on this cookie.
| const dbRoles: string[] = Array.isArray(user?.roles) ? user.roles : []; | ||
| const jwtRoles: string[] = | ||
| (user?.payload?.['https://topcoder-dev.com/claims/roles'] as string[]) || | ||
| (user?.payload?.['https://topcoder-dev.com/roles'] as string[]) || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[❗❗ correctness]
The change from https://topcoder-dev.com/claims/roles to https://topcoder-dev.com/roles may affect how roles are extracted from the JWT payload. Ensure that this change is intentional and that all parts of the system consuming this payload are updated accordingly.
| * @returns The created UserResponseDto. | ||
| */ | ||
| @Post() | ||
| @UseGuards(AuthRequiredGuard, ScopesGuard) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[❗❗ security]
Adding ScopesGuard and @Scopes('auth0') to the registerUser endpoint changes its access control. Verify that all clients using this endpoint are aware of the new requirement for the auth0 scope.
| * @throws UnauthorizedException if credentials are invalid. | ||
| */ | ||
| @Post('login') | ||
| @UseGuards(AuthRequiredGuard, ScopesGuard) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[❗❗ security]
The login endpoint now requires AuthRequiredGuard and ScopesGuard, which changes its accessibility. Ensure that this change aligns with the intended use case and that clients are informed of the new authentication requirements.
| * @throws NotFoundException if the user is not found. | ||
| */ | ||
| @Post('roles') | ||
| @UseGuards(AuthRequiredGuard, ScopesGuard) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[❗❗ security]
The roles endpoint now requires AuthRequiredGuard and ScopesGuard, which alters its accessibility. Confirm that this change is intentional and that all clients are updated to handle the new authentication requirements.
| * @throws NotFoundException if the user is not found. | ||
| */ | ||
| @Post('changePassword') | ||
| @UseGuards(AuthRequiredGuard, ScopesGuard) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[❗❗ security]
The changePassword endpoint now requires AuthRequiredGuard and ScopesGuard, which changes its access control. Ensure that this change is intentional and that all clients are updated to handle the new authentication requirements.
| expect(memberUpdateMock).toHaveBeenCalledWith({ | ||
| where: { userId }, | ||
| expect(memberUpdateManyMock).toHaveBeenCalledWith({ | ||
| where: { userId: BigInt(userId) }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[correctness]
The use of BigInt for userId in the where clause is inconsistent with other parts of the code where userId is used as a regular number. Ensure that the type of userId is consistent throughout the codebase to avoid potential type-related issues.
| expect(memberUpdateMock).toHaveBeenCalledWith({ | ||
| where: { userId }, | ||
| expect(memberUpdateManyMock).toHaveBeenCalledWith({ | ||
| where: { userId: BigInt(userId) }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[correctness]
The use of BigInt for userId in the where clause is inconsistent with other parts of the code where userId is used as a regular number. Ensure that the type of userId is consistent throughout the codebase to avoid potential type-related issues.
| } | ||
|
|
||
| if (emailChanged) { | ||
| const memberUserId = BigInt(userId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[correctness]
The conversion of userId to BigInt is a new addition. Ensure that userId is always a valid number that can be safely converted to BigInt without causing runtime errors. Consider adding validation or error handling if this assumption might not hold.
| await this.memberPrisma.member.update({ | ||
| where: { userId }, | ||
| const updateResult = await this.memberPrisma.member.update({ | ||
| where: { userId: memberUserId }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[💡 maintainability]
The variable updateResult is declared but not used. If the result of the update operation is not needed, consider removing the variable declaration to avoid confusion and potential linting issues.
| /* eslint-disable */ | ||
| module.exports = { ...require('.') } | ||
| // biome-ignore-all lint: generated file | ||
| module.exports = { ...require('#main-entry-point') } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[❗❗ correctness]
The change from require('.') to require('#main-entry-point') could potentially break functionality if #main-entry-point does not resolve correctly in all environments. Ensure that #main-entry-point is correctly configured and accessible in the environments where this code will run.
| { | ||
| "fromEnvVar": null, | ||
| "value": "debian-openssl-1.1.x", | ||
| "value": "debian-openssl-3.0.x", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[❗❗ correctness]
The update from debian-openssl-1.1.x to debian-openssl-3.0.x should be verified for compatibility with the rest of the system. Ensure that all dependencies and environments support OpenSSL 3.0.x to prevent runtime issues.
| @@ -0,0 +1,2 @@ | |||
| "use strict";var F=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var U=Object.prototype.hasOwnProperty;var L=(e,t)=>{for(var n in t)F(e,n,{get:t[n],enumerable:!0})},N=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of B(t))!U.call(e,o)&&o!==n&&F(e,o,{get:()=>t[o],enumerable:!(r=j(t,o))||r.enumerable});return e};var C=e=>N(F({},"__esModule",{value:!0}),e);var kt={};L(kt,{QueryEngine:()=>k,__wbg_Error_e83987f665cf5504:()=>J,__wbg_Number_bb48ca12f395cd08:()=>X,__wbg_String_8f0eb39a4a4c2f66:()=>Y,__wbg___wbindgen_bigint_get_as_i64_f3ebc5a755000afd:()=>K,__wbg___wbindgen_boolean_get_6d5a1ee65bab5f68:()=>Z,__wbg___wbindgen_debug_string_df47ffb5e35e6763:()=>ee,__wbg___wbindgen_in_bb933bd9e1b3bc0f:()=>te,__wbg___wbindgen_is_bigint_cb320707dcd35f0b:()=>ne,__wbg___wbindgen_is_function_ee8a6c5833c90377:()=>re,__wbg___wbindgen_is_object_c818261d21f283a4:()=>_e,__wbg___wbindgen_is_string_fbb76cb2940daafd:()=>oe,__wbg___wbindgen_is_undefined_2d472862bd29a478:()=>ce,__wbg___wbindgen_jsval_eq_6b13ab83478b1c50:()=>ie,__wbg___wbindgen_jsval_loose_eq_b664b38a2f582147:()=>ue,__wbg___wbindgen_number_get_a20bf9b85341449d:()=>se,__wbg___wbindgen_string_get_e4f06c90489ad01b:()=>be,__wbg___wbindgen_throw_b855445ff6a94295:()=>fe,__wbg__wbg_cb_unref_2454a539ea5790d9:()=>ae,__wbg_call_525440f72fbfc0ea:()=>ge,__wbg_call_e762c39fa8ea36bf:()=>le,__wbg_crypto_805be4ce92f1e370:()=>de,__wbg_done_2042aa2670fb1db1:()=>we,__wbg_entries_e171b586f8f6bdbf:()=>pe,__wbg_exec_fdeec61d47617356:()=>xe,__wbg_getRandomValues_f6a868620c8bab49:()=>ye,__wbg_getTime_14776bfb48a1bff9:()=>me,__wbg_get_7bed016f185add81:()=>he,__wbg_get_ece95cf6585650d9:()=>Te,__wbg_get_efcb449f58ec27c2:()=>Ae,__wbg_get_with_ref_key_1dc361bd10053bfe:()=>Se,__wbg_has_787fafc980c3ccdb:()=>Fe,__wbg_instanceof_ArrayBuffer_70beb1189ca63b38:()=>Ie,__wbg_instanceof_Map_8579b5e2ab5437c7:()=>qe,__wbg_instanceof_Promise_001fdd42afa1b7ef:()=>Ee,__wbg_instanceof_Uint8Array_20c8e73002f7af98:()=>ke,__wbg_isArray_96e0af9891d0945d:()=>Oe,__wbg_isSafeInteger_d216eda7911dde36:()=>Me,__wbg_iterator_e5822695327a3c39:()=>ve,__wbg_keys_b4d27b02ad14f4be:()=>De,__wbg_length_69bca3cb64fc8748:()=>Re,__wbg_length_cdd215e10d9dd507:()=>je,__wbg_msCrypto_2ac4d17c4748234a:()=>Be,__wbg_new_0_f9740686d739025c:()=>Ue,__wbg_new_1acc0b6eea89d040:()=>Le,__wbg_new_23fa8b12a239f036:()=>Ne,__wbg_new_3c3d849046688a66:()=>Ce,__wbg_new_5a79be3ab53b8aa5:()=>$e,__wbg_new_68651c719dcda04e:()=>Ve,__wbg_new_e17d9f43105b08be:()=>We,__wbg_new_from_slice_92f4d78ca282a2d2:()=>ze,__wbg_new_no_args_ee98eee5275000a4:()=>Pe,__wbg_new_with_length_01aa0dc35aa13543:()=>Ge,__wbg_next_020810e0ae8ebcb0:()=>Qe,__wbg_next_2c826fe5dfec6b6a:()=>He,__wbg_node_ecc8306b9857f33d:()=>Je,__wbg_now_793306c526e2e3b6:()=>Xe,__wbg_now_7fd00a794a07d388:()=>Ye,__wbg_now_b3f7572f6ef3d3a9:()=>Ke,__wbg_process_5cff2739921be718:()=>Ze,__wbg_prototypesetcall_2a6620b6922694b2:()=>et,__wbg_push_df81a39d04db858c:()=>tt,__wbg_queueMicrotask_5a8a9131f3f0b37b:()=>nt,__wbg_queueMicrotask_6d79674585219521:()=>rt,__wbg_randomFillSync_d3c85af7e31cf1f8:()=>_t,__wbg_require_0c566c6f2eef6c79:()=>ot,__wbg_resolve_caf97c30b83f7053:()=>ct,__wbg_setTimeout_5d6a1d4fc51ea450:()=>it,__wbg_set_3f1d0b984ed272ed:()=>ut,__wbg_set_907fb406c34a251d:()=>st,__wbg_set_c213c871859d6500:()=>bt,__wbg_set_c2abbebe8b9ebee1:()=>ft,__wbg_set_wasm:()=>$,__wbg_static_accessor_GLOBAL_89e1d9ac6a1b250e:()=>at,__wbg_static_accessor_GLOBAL_THIS_8b530f326a9e48ac:()=>gt,__wbg_static_accessor_SELF_6fdf4b64710cc91b:()=>lt,__wbg_static_accessor_WINDOW_b45bfc5a37f6cfa2:()=>dt,__wbg_subarray_480600f3d6a9f26c:()=>wt,__wbg_then_4f46f6544e6b4a28:()=>pt,__wbg_then_70d05cf780a18d77:()=>xt,__wbg_valueOf_9eee4828c11458ca:()=>yt,__wbg_value_692627309814bb8c:()=>mt,__wbg_versions_a8e5a362e1f16442:()=>ht,__wbindgen_cast_2241b6af4c4b2941:()=>Tt,__wbindgen_cast_4625c577ab2ec9ee:()=>At,__wbindgen_cast_7bf296c42657ff30:()=>St,__wbindgen_cast_9ae0607507abb057:()=>Ft,__wbindgen_cast_cb9088102bce6b30:()=>It,__wbindgen_cast_d6cd19b81560fd6e:()=>qt,__wbindgen_init_externref_table:()=>Et,debug_panic:()=>G,getBuildTimeInfo:()=>P});module.exports=C(kt);var T=()=>{};T.prototype=T;let _;function $(e){_=e}let A=null;function y(){return(A===null||A.byteLength===0)&&(A=new Uint8Array(_.memory.buffer)),A}let S=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});S.decode();const V=2146435072;let I=0;function W(e,t){return I+=t,I>=V&&(S=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),S.decode(),I=t),S.decode(y().subarray(e,e+t))}function w(e,t){return e=e>>>0,W(e,t)}let s=0;const m=new TextEncoder;"encodeInto"in m||(m.encodeInto=function(e,t){const n=m.encode(e);return t.set(n),{read:e.length,written:n.length}});function b(e,t,n){if(n===void 0){const u=m.encode(e),f=t(u.length,1)>>>0;return y().subarray(f,f+u.length).set(u),s=u.length,f}let r=e.length,o=t(r,1)>>>0;const i=y();let c=0;for(;c<r;c++){const u=e.charCodeAt(c);if(u>127)break;i[o+c]=u}if(c!==r){c!==0&&(e=e.slice(c)),o=n(o,r,r=c+e.length*3,1)>>>0;const u=y().subarray(o+c,o+r),f=m.encodeInto(e,u);c+=f.written,o=n(o,r,c,1)>>>0}return s=c,o}let p=null;function l(){return(p===null||p.buffer.detached===!0||p.buffer.detached===void 0&&p.buffer!==_.memory.buffer)&&(p=new DataView(_.memory.buffer)),p}function a(e){return e==null}function q(e){const t=typeof e;if(t=="number"||t=="boolean"||e==null)return`${e}`;if(t=="string")return`"${e}"`;if(t=="symbol"){const o=e.description;return o==null?"Symbol":`Symbol(${o})`}if(t=="function"){const o=e.name;return typeof o=="string"&&o.length>0?`Function(${o})`:"Function"}if(Array.isArray(e)){const o=e.length;let i="[";o>0&&(i+=q(e[0]));for(let c=1;c<o;c++)i+=", "+q(e[c]);return i+="]",i}const n=/\[object ([^\]]+)\]/.exec(toString.call(e));let r;if(n&&n.length>1)r=n[1];else return toString.call(e);if(r=="Object")try{return"Object("+JSON.stringify(e)+")"}catch{return"Object"}return e instanceof Error?`${e.name}: ${e.message} | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[maintainability]
The use of var for variable declarations can lead to unexpected behavior due to its function-scoped nature. Consider using let or const for block-scoped variables to improve maintainability and prevent potential issues with variable hoisting.
| @@ -0,0 +1,2 @@ | |||
| "use strict";var F=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var U=Object.prototype.hasOwnProperty;var L=(e,t)=>{for(var n in t)F(e,n,{get:t[n],enumerable:!0})},N=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of B(t))!U.call(e,o)&&o!==n&&F(e,o,{get:()=>t[o],enumerable:!(r=j(t,o))||r.enumerable});return e};var C=e=>N(F({},"__esModule",{value:!0}),e);var kt={};L(kt,{QueryEngine:()=>k,__wbg_Error_e83987f665cf5504:()=>J,__wbg_Number_bb48ca12f395cd08:()=>X,__wbg_String_8f0eb39a4a4c2f66:()=>Y,__wbg___wbindgen_bigint_get_as_i64_f3ebc5a755000afd:()=>K,__wbg___wbindgen_boolean_get_6d5a1ee65bab5f68:()=>Z,__wbg___wbindgen_debug_string_df47ffb5e35e6763:()=>ee,__wbg___wbindgen_in_bb933bd9e1b3bc0f:()=>te,__wbg___wbindgen_is_bigint_cb320707dcd35f0b:()=>ne,__wbg___wbindgen_is_function_ee8a6c5833c90377:()=>re,__wbg___wbindgen_is_object_c818261d21f283a4:()=>_e,__wbg___wbindgen_is_string_fbb76cb2940daafd:()=>oe,__wbg___wbindgen_is_undefined_2d472862bd29a478:()=>ce,__wbg___wbindgen_jsval_eq_6b13ab83478b1c50:()=>ie,__wbg___wbindgen_jsval_loose_eq_b664b38a2f582147:()=>ue,__wbg___wbindgen_number_get_a20bf9b85341449d:()=>se,__wbg___wbindgen_string_get_e4f06c90489ad01b:()=>be,__wbg___wbindgen_throw_b855445ff6a94295:()=>fe,__wbg__wbg_cb_unref_2454a539ea5790d9:()=>ae,__wbg_call_525440f72fbfc0ea:()=>ge,__wbg_call_e762c39fa8ea36bf:()=>le,__wbg_crypto_805be4ce92f1e370:()=>de,__wbg_done_2042aa2670fb1db1:()=>we,__wbg_entries_e171b586f8f6bdbf:()=>pe,__wbg_exec_fdeec61d47617356:()=>xe,__wbg_getRandomValues_f6a868620c8bab49:()=>ye,__wbg_getTime_14776bfb48a1bff9:()=>me,__wbg_get_7bed016f185add81:()=>he,__wbg_get_ece95cf6585650d9:()=>Te,__wbg_get_efcb449f58ec27c2:()=>Ae,__wbg_get_with_ref_key_1dc361bd10053bfe:()=>Se,__wbg_has_787fafc980c3ccdb:()=>Fe,__wbg_instanceof_ArrayBuffer_70beb1189ca63b38:()=>Ie,__wbg_instanceof_Map_8579b5e2ab5437c7:()=>qe,__wbg_instanceof_Promise_001fdd42afa1b7ef:()=>Ee,__wbg_instanceof_Uint8Array_20c8e73002f7af98:()=>ke,__wbg_isArray_96e0af9891d0945d:()=>Oe,__wbg_isSafeInteger_d216eda7911dde36:()=>Me,__wbg_iterator_e5822695327a3c39:()=>ve,__wbg_keys_b4d27b02ad14f4be:()=>De,__wbg_length_69bca3cb64fc8748:()=>Re,__wbg_length_cdd215e10d9dd507:()=>je,__wbg_msCrypto_2ac4d17c4748234a:()=>Be,__wbg_new_0_f9740686d739025c:()=>Ue,__wbg_new_1acc0b6eea89d040:()=>Le,__wbg_new_23fa8b12a239f036:()=>Ne,__wbg_new_3c3d849046688a66:()=>Ce,__wbg_new_5a79be3ab53b8aa5:()=>$e,__wbg_new_68651c719dcda04e:()=>Ve,__wbg_new_e17d9f43105b08be:()=>We,__wbg_new_from_slice_92f4d78ca282a2d2:()=>ze,__wbg_new_no_args_ee98eee5275000a4:()=>Pe,__wbg_new_with_length_01aa0dc35aa13543:()=>Ge,__wbg_next_020810e0ae8ebcb0:()=>Qe,__wbg_next_2c826fe5dfec6b6a:()=>He,__wbg_node_ecc8306b9857f33d:()=>Je,__wbg_now_793306c526e2e3b6:()=>Xe,__wbg_now_7fd00a794a07d388:()=>Ye,__wbg_now_b3f7572f6ef3d3a9:()=>Ke,__wbg_process_5cff2739921be718:()=>Ze,__wbg_prototypesetcall_2a6620b6922694b2:()=>et,__wbg_push_df81a39d04db858c:()=>tt,__wbg_queueMicrotask_5a8a9131f3f0b37b:()=>nt,__wbg_queueMicrotask_6d79674585219521:()=>rt,__wbg_randomFillSync_d3c85af7e31cf1f8:()=>_t,__wbg_require_0c566c6f2eef6c79:()=>ot,__wbg_resolve_caf97c30b83f7053:()=>ct,__wbg_setTimeout_5d6a1d4fc51ea450:()=>it,__wbg_set_3f1d0b984ed272ed:()=>ut,__wbg_set_907fb406c34a251d:()=>st,__wbg_set_c213c871859d6500:()=>bt,__wbg_set_c2abbebe8b9ebee1:()=>ft,__wbg_set_wasm:()=>$,__wbg_static_accessor_GLOBAL_89e1d9ac6a1b250e:()=>at,__wbg_static_accessor_GLOBAL_THIS_8b530f326a9e48ac:()=>gt,__wbg_static_accessor_SELF_6fdf4b64710cc91b:()=>lt,__wbg_static_accessor_WINDOW_b45bfc5a37f6cfa2:()=>dt,__wbg_subarray_480600f3d6a9f26c:()=>wt,__wbg_then_4f46f6544e6b4a28:()=>pt,__wbg_then_70d05cf780a18d77:()=>xt,__wbg_valueOf_9eee4828c11458ca:()=>yt,__wbg_value_692627309814bb8c:()=>mt,__wbg_versions_a8e5a362e1f16442:()=>ht,__wbindgen_cast_2241b6af4c4b2941:()=>Tt,__wbindgen_cast_4625c577ab2ec9ee:()=>At,__wbindgen_cast_7bf296c42657ff30:()=>St,__wbindgen_cast_9ae0607507abb057:()=>Ft,__wbindgen_cast_cb9088102bce6b30:()=>It,__wbindgen_cast_d6cd19b81560fd6e:()=>qt,__wbindgen_init_externref_table:()=>Et,debug_panic:()=>G,getBuildTimeInfo:()=>P});module.exports=C(kt);var T=()=>{};T.prototype=T;let _;function $(e){_=e}let A=null;function y(){return(A===null||A.byteLength===0)&&(A=new Uint8Array(_.memory.buffer)),A}let S=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});S.decode();const V=2146435072;let I=0;function W(e,t){return I+=t,I>=V&&(S=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),S.decode(),I=t),S.decode(y().subarray(e,e+t))}function w(e,t){return e=e>>>0,W(e,t)}let s=0;const m=new TextEncoder;"encodeInto"in m||(m.encodeInto=function(e,t){const n=m.encode(e);return t.set(n),{read:e.length,written:n.length}});function b(e,t,n){if(n===void 0){const u=m.encode(e),f=t(u.length,1)>>>0;return y().subarray(f,f+u.length).set(u),s=u.length,f}let r=e.length,o=t(r,1)>>>0;const i=y();let c=0;for(;c<r;c++){const u=e.charCodeAt(c);if(u>127)break;i[o+c]=u}if(c!==r){c!==0&&(e=e.slice(c)),o=n(o,r,r=c+e.length*3,1)>>>0;const u=y().subarray(o+c,o+r),f=m.encodeInto(e,u);c+=f.written,o=n(o,r,c,1)>>>0}return s=c,o}let p=null;function l(){return(p===null||p.buffer.detached===!0||p.buffer.detached===void 0&&p.buffer!==_.memory.buffer)&&(p=new DataView(_.memory.buffer)),p}function a(e){return e==null}function q(e){const t=typeof e;if(t=="number"||t=="boolean"||e==null)return`${e}`;if(t=="string")return`"${e}"`;if(t=="symbol"){const o=e.description;return o==null?"Symbol":`Symbol(${o})`}if(t=="function"){const o=e.name;return typeof o=="string"&&o.length>0?`Function(${o})`:"Function"}if(Array.isArray(e)){const o=e.length;let i="[";o>0&&(i+=q(e[0]));for(let c=1;c<o;c++)i+=", "+q(e[c]);return i+="]",i}const n=/\[object ([^\]]+)\]/.exec(toString.call(e));let r;if(n&&n.length>1)r=n[1];else return toString.call(e);if(r=="Object")try{return"Object("+JSON.stringify(e)+")"}catch{return"Object"}return e instanceof Error?`${e.name}: ${e.message} | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[💡 readability]
The line is excessively long, which can hinder readability and maintainability. Consider breaking it into multiple lines or using a module bundler/minifier to handle such transformations in a build step.
| @@ -0,0 +1,2 @@ | |||
| "use strict";var F=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var U=Object.prototype.hasOwnProperty;var L=(e,t)=>{for(var n in t)F(e,n,{get:t[n],enumerable:!0})},N=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of B(t))!U.call(e,o)&&o!==n&&F(e,o,{get:()=>t[o],enumerable:!(r=j(t,o))||r.enumerable});return e};var C=e=>N(F({},"__esModule",{value:!0}),e);var kt={};L(kt,{QueryEngine:()=>k,__wbg_Error_e83987f665cf5504:()=>J,__wbg_Number_bb48ca12f395cd08:()=>X,__wbg_String_8f0eb39a4a4c2f66:()=>Y,__wbg___wbindgen_bigint_get_as_i64_f3ebc5a755000afd:()=>K,__wbg___wbindgen_boolean_get_6d5a1ee65bab5f68:()=>Z,__wbg___wbindgen_debug_string_df47ffb5e35e6763:()=>ee,__wbg___wbindgen_in_bb933bd9e1b3bc0f:()=>te,__wbg___wbindgen_is_bigint_cb320707dcd35f0b:()=>ne,__wbg___wbindgen_is_function_ee8a6c5833c90377:()=>re,__wbg___wbindgen_is_object_c818261d21f283a4:()=>_e,__wbg___wbindgen_is_string_fbb76cb2940daafd:()=>oe,__wbg___wbindgen_is_undefined_2d472862bd29a478:()=>ce,__wbg___wbindgen_jsval_eq_6b13ab83478b1c50:()=>ie,__wbg___wbindgen_jsval_loose_eq_b664b38a2f582147:()=>ue,__wbg___wbindgen_number_get_a20bf9b85341449d:()=>se,__wbg___wbindgen_string_get_e4f06c90489ad01b:()=>be,__wbg___wbindgen_throw_b855445ff6a94295:()=>fe,__wbg__wbg_cb_unref_2454a539ea5790d9:()=>ae,__wbg_call_525440f72fbfc0ea:()=>ge,__wbg_call_e762c39fa8ea36bf:()=>le,__wbg_crypto_805be4ce92f1e370:()=>de,__wbg_done_2042aa2670fb1db1:()=>we,__wbg_entries_e171b586f8f6bdbf:()=>pe,__wbg_exec_fdeec61d47617356:()=>xe,__wbg_getRandomValues_f6a868620c8bab49:()=>ye,__wbg_getTime_14776bfb48a1bff9:()=>me,__wbg_get_7bed016f185add81:()=>he,__wbg_get_ece95cf6585650d9:()=>Te,__wbg_get_efcb449f58ec27c2:()=>Ae,__wbg_get_with_ref_key_1dc361bd10053bfe:()=>Se,__wbg_has_787fafc980c3ccdb:()=>Fe,__wbg_instanceof_ArrayBuffer_70beb1189ca63b38:()=>Ie,__wbg_instanceof_Map_8579b5e2ab5437c7:()=>qe,__wbg_instanceof_Promise_001fdd42afa1b7ef:()=>Ee,__wbg_instanceof_Uint8Array_20c8e73002f7af98:()=>ke,__wbg_isArray_96e0af9891d0945d:()=>Oe,__wbg_isSafeInteger_d216eda7911dde36:()=>Me,__wbg_iterator_e5822695327a3c39:()=>ve,__wbg_keys_b4d27b02ad14f4be:()=>De,__wbg_length_69bca3cb64fc8748:()=>Re,__wbg_length_cdd215e10d9dd507:()=>je,__wbg_msCrypto_2ac4d17c4748234a:()=>Be,__wbg_new_0_f9740686d739025c:()=>Ue,__wbg_new_1acc0b6eea89d040:()=>Le,__wbg_new_23fa8b12a239f036:()=>Ne,__wbg_new_3c3d849046688a66:()=>Ce,__wbg_new_5a79be3ab53b8aa5:()=>$e,__wbg_new_68651c719dcda04e:()=>Ve,__wbg_new_e17d9f43105b08be:()=>We,__wbg_new_from_slice_92f4d78ca282a2d2:()=>ze,__wbg_new_no_args_ee98eee5275000a4:()=>Pe,__wbg_new_with_length_01aa0dc35aa13543:()=>Ge,__wbg_next_020810e0ae8ebcb0:()=>Qe,__wbg_next_2c826fe5dfec6b6a:()=>He,__wbg_node_ecc8306b9857f33d:()=>Je,__wbg_now_793306c526e2e3b6:()=>Xe,__wbg_now_7fd00a794a07d388:()=>Ye,__wbg_now_b3f7572f6ef3d3a9:()=>Ke,__wbg_process_5cff2739921be718:()=>Ze,__wbg_prototypesetcall_2a6620b6922694b2:()=>et,__wbg_push_df81a39d04db858c:()=>tt,__wbg_queueMicrotask_5a8a9131f3f0b37b:()=>nt,__wbg_queueMicrotask_6d79674585219521:()=>rt,__wbg_randomFillSync_d3c85af7e31cf1f8:()=>_t,__wbg_require_0c566c6f2eef6c79:()=>ot,__wbg_resolve_caf97c30b83f7053:()=>ct,__wbg_setTimeout_5d6a1d4fc51ea450:()=>it,__wbg_set_3f1d0b984ed272ed:()=>ut,__wbg_set_907fb406c34a251d:()=>st,__wbg_set_c213c871859d6500:()=>bt,__wbg_set_c2abbebe8b9ebee1:()=>ft,__wbg_set_wasm:()=>$,__wbg_static_accessor_GLOBAL_89e1d9ac6a1b250e:()=>at,__wbg_static_accessor_GLOBAL_THIS_8b530f326a9e48ac:()=>gt,__wbg_static_accessor_SELF_6fdf4b64710cc91b:()=>lt,__wbg_static_accessor_WINDOW_b45bfc5a37f6cfa2:()=>dt,__wbg_subarray_480600f3d6a9f26c:()=>wt,__wbg_then_4f46f6544e6b4a28:()=>pt,__wbg_then_70d05cf780a18d77:()=>xt,__wbg_valueOf_9eee4828c11458ca:()=>yt,__wbg_value_692627309814bb8c:()=>mt,__wbg_versions_a8e5a362e1f16442:()=>ht,__wbindgen_cast_2241b6af4c4b2941:()=>Tt,__wbindgen_cast_4625c577ab2ec9ee:()=>At,__wbindgen_cast_7bf296c42657ff30:()=>St,__wbindgen_cast_9ae0607507abb057:()=>Ft,__wbindgen_cast_cb9088102bce6b30:()=>It,__wbindgen_cast_d6cd19b81560fd6e:()=>qt,__wbindgen_init_externref_table:()=>Et,debug_panic:()=>G,getBuildTimeInfo:()=>P});module.exports=C(kt);var T=()=>{};T.prototype=T;let _;function $(e){_=e}let A=null;function y(){return(A===null||A.byteLength===0)&&(A=new Uint8Array(_.memory.buffer)),A}let S=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});S.decode();const V=2146435072;let I=0;function W(e,t){return I+=t,I>=V&&(S=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),S.decode(),I=t),S.decode(y().subarray(e,e+t))}function w(e,t){return e=e>>>0,W(e,t)}let s=0;const m=new TextEncoder;"encodeInto"in m||(m.encodeInto=function(e,t){const n=m.encode(e);return t.set(n),{read:e.length,written:n.length}});function b(e,t,n){if(n===void 0){const u=m.encode(e),f=t(u.length,1)>>>0;return y().subarray(f,f+u.length).set(u),s=u.length,f}let r=e.length,o=t(r,1)>>>0;const i=y();let c=0;for(;c<r;c++){const u=e.charCodeAt(c);if(u>127)break;i[o+c]=u}if(c!==r){c!==0&&(e=e.slice(c)),o=n(o,r,r=c+e.length*3,1)>>>0;const u=y().subarray(o+c,o+r),f=m.encodeInto(e,u);c+=f.written,o=n(o,r,c,1)>>>0}return s=c,o}let p=null;function l(){return(p===null||p.buffer.detached===!0||p.buffer.detached===void 0&&p.buffer!==_.memory.buffer)&&(p=new DataView(_.memory.buffer)),p}function a(e){return e==null}function q(e){const t=typeof e;if(t=="number"||t=="boolean"||e==null)return`${e}`;if(t=="string")return`"${e}"`;if(t=="symbol"){const o=e.description;return o==null?"Symbol":`Symbol(${o})`}if(t=="function"){const o=e.name;return typeof o=="string"&&o.length>0?`Function(${o})`:"Function"}if(Array.isArray(e)){const o=e.length;let i="[";o>0&&(i+=q(e[0]));for(let c=1;c<o;c++)i+=", "+q(e[c]);return i+="]",i}const n=/\[object ([^\]]+)\]/.exec(toString.call(e));let r;if(n&&n.length>1)r=n[1];else return toString.call(e);if(r=="Object")try{return"Object("+JSON.stringify(e)+")"}catch{return"Object"}return e instanceof Error?`${e.name}: ${e.message} | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[correctness]
The use of Object.defineProperty and similar methods without checking for property existence or configurability can lead to runtime errors if the properties are non-configurable. Ensure that these operations are safe or handle potential exceptions.
| @@ -0,0 +1,2 @@ | |||
| "use strict";var F=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var U=Object.prototype.hasOwnProperty;var L=(e,t)=>{for(var n in t)F(e,n,{get:t[n],enumerable:!0})},N=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of B(t))!U.call(e,o)&&o!==n&&F(e,o,{get:()=>t[o],enumerable:!(r=j(t,o))||r.enumerable});return e};var C=e=>N(F({},"__esModule",{value:!0}),e);var kt={};L(kt,{QueryEngine:()=>k,__wbg_Error_e83987f665cf5504:()=>J,__wbg_Number_bb48ca12f395cd08:()=>X,__wbg_String_8f0eb39a4a4c2f66:()=>Y,__wbg___wbindgen_bigint_get_as_i64_f3ebc5a755000afd:()=>K,__wbg___wbindgen_boolean_get_6d5a1ee65bab5f68:()=>Z,__wbg___wbindgen_debug_string_df47ffb5e35e6763:()=>ee,__wbg___wbindgen_in_bb933bd9e1b3bc0f:()=>te,__wbg___wbindgen_is_bigint_cb320707dcd35f0b:()=>ne,__wbg___wbindgen_is_function_ee8a6c5833c90377:()=>re,__wbg___wbindgen_is_object_c818261d21f283a4:()=>_e,__wbg___wbindgen_is_string_fbb76cb2940daafd:()=>oe,__wbg___wbindgen_is_undefined_2d472862bd29a478:()=>ce,__wbg___wbindgen_jsval_eq_6b13ab83478b1c50:()=>ie,__wbg___wbindgen_jsval_loose_eq_b664b38a2f582147:()=>ue,__wbg___wbindgen_number_get_a20bf9b85341449d:()=>se,__wbg___wbindgen_string_get_e4f06c90489ad01b:()=>be,__wbg___wbindgen_throw_b855445ff6a94295:()=>fe,__wbg__wbg_cb_unref_2454a539ea5790d9:()=>ae,__wbg_call_525440f72fbfc0ea:()=>ge,__wbg_call_e762c39fa8ea36bf:()=>le,__wbg_crypto_805be4ce92f1e370:()=>de,__wbg_done_2042aa2670fb1db1:()=>we,__wbg_entries_e171b586f8f6bdbf:()=>pe,__wbg_exec_fdeec61d47617356:()=>xe,__wbg_getRandomValues_f6a868620c8bab49:()=>ye,__wbg_getTime_14776bfb48a1bff9:()=>me,__wbg_get_7bed016f185add81:()=>he,__wbg_get_ece95cf6585650d9:()=>Te,__wbg_get_efcb449f58ec27c2:()=>Ae,__wbg_get_with_ref_key_1dc361bd10053bfe:()=>Se,__wbg_has_787fafc980c3ccdb:()=>Fe,__wbg_instanceof_ArrayBuffer_70beb1189ca63b38:()=>Ie,__wbg_instanceof_Map_8579b5e2ab5437c7:()=>qe,__wbg_instanceof_Promise_001fdd42afa1b7ef:()=>Ee,__wbg_instanceof_Uint8Array_20c8e73002f7af98:()=>ke,__wbg_isArray_96e0af9891d0945d:()=>Oe,__wbg_isSafeInteger_d216eda7911dde36:()=>Me,__wbg_iterator_e5822695327a3c39:()=>ve,__wbg_keys_b4d27b02ad14f4be:()=>De,__wbg_length_69bca3cb64fc8748:()=>Re,__wbg_length_cdd215e10d9dd507:()=>je,__wbg_msCrypto_2ac4d17c4748234a:()=>Be,__wbg_new_0_f9740686d739025c:()=>Ue,__wbg_new_1acc0b6eea89d040:()=>Le,__wbg_new_23fa8b12a239f036:()=>Ne,__wbg_new_3c3d849046688a66:()=>Ce,__wbg_new_5a79be3ab53b8aa5:()=>$e,__wbg_new_68651c719dcda04e:()=>Ve,__wbg_new_e17d9f43105b08be:()=>We,__wbg_new_from_slice_92f4d78ca282a2d2:()=>ze,__wbg_new_no_args_ee98eee5275000a4:()=>Pe,__wbg_new_with_length_01aa0dc35aa13543:()=>Ge,__wbg_next_020810e0ae8ebcb0:()=>Qe,__wbg_next_2c826fe5dfec6b6a:()=>He,__wbg_node_ecc8306b9857f33d:()=>Je,__wbg_now_793306c526e2e3b6:()=>Xe,__wbg_now_7fd00a794a07d388:()=>Ye,__wbg_now_b3f7572f6ef3d3a9:()=>Ke,__wbg_process_5cff2739921be718:()=>Ze,__wbg_prototypesetcall_2a6620b6922694b2:()=>et,__wbg_push_df81a39d04db858c:()=>tt,__wbg_queueMicrotask_5a8a9131f3f0b37b:()=>nt,__wbg_queueMicrotask_6d79674585219521:()=>rt,__wbg_randomFillSync_d3c85af7e31cf1f8:()=>_t,__wbg_require_0c566c6f2eef6c79:()=>ot,__wbg_resolve_caf97c30b83f7053:()=>ct,__wbg_setTimeout_5d6a1d4fc51ea450:()=>it,__wbg_set_3f1d0b984ed272ed:()=>ut,__wbg_set_907fb406c34a251d:()=>st,__wbg_set_c213c871859d6500:()=>bt,__wbg_set_c2abbebe8b9ebee1:()=>ft,__wbg_set_wasm:()=>$,__wbg_static_accessor_GLOBAL_89e1d9ac6a1b250e:()=>at,__wbg_static_accessor_GLOBAL_THIS_8b530f326a9e48ac:()=>gt,__wbg_static_accessor_SELF_6fdf4b64710cc91b:()=>lt,__wbg_static_accessor_WINDOW_b45bfc5a37f6cfa2:()=>dt,__wbg_subarray_480600f3d6a9f26c:()=>wt,__wbg_then_4f46f6544e6b4a28:()=>pt,__wbg_then_70d05cf780a18d77:()=>xt,__wbg_valueOf_9eee4828c11458ca:()=>yt,__wbg_value_692627309814bb8c:()=>mt,__wbg_versions_a8e5a362e1f16442:()=>ht,__wbindgen_cast_2241b6af4c4b2941:()=>Tt,__wbindgen_cast_4625c577ab2ec9ee:()=>At,__wbindgen_cast_7bf296c42657ff30:()=>St,__wbindgen_cast_9ae0607507abb057:()=>Ft,__wbindgen_cast_cb9088102bce6b30:()=>It,__wbindgen_cast_d6cd19b81560fd6e:()=>qt,__wbindgen_init_externref_table:()=>Et,debug_panic:()=>G,getBuildTimeInfo:()=>P});module.exports=C(kt);var T=()=>{};T.prototype=T;let _;function $(e){_=e}let A=null;function y(){return(A===null||A.byteLength===0)&&(A=new Uint8Array(_.memory.buffer)),A}let S=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});S.decode();const V=2146435072;let I=0;function W(e,t){return I+=t,I>=V&&(S=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),S.decode(),I=t),S.decode(y().subarray(e,e+t))}function w(e,t){return e=e>>>0,W(e,t)}let s=0;const m=new TextEncoder;"encodeInto"in m||(m.encodeInto=function(e,t){const n=m.encode(e);return t.set(n),{read:e.length,written:n.length}});function b(e,t,n){if(n===void 0){const u=m.encode(e),f=t(u.length,1)>>>0;return y().subarray(f,f+u.length).set(u),s=u.length,f}let r=e.length,o=t(r,1)>>>0;const i=y();let c=0;for(;c<r;c++){const u=e.charCodeAt(c);if(u>127)break;i[o+c]=u}if(c!==r){c!==0&&(e=e.slice(c)),o=n(o,r,r=c+e.length*3,1)>>>0;const u=y().subarray(o+c,o+r),f=m.encodeInto(e,u);c+=f.written,o=n(o,r,c,1)>>>0}return s=c,o}let p=null;function l(){return(p===null||p.buffer.detached===!0||p.buffer.detached===void 0&&p.buffer!==_.memory.buffer)&&(p=new DataView(_.memory.buffer)),p}function a(e){return e==null}function q(e){const t=typeof e;if(t=="number"||t=="boolean"||e==null)return`${e}`;if(t=="string")return`"${e}"`;if(t=="symbol"){const o=e.description;return o==null?"Symbol":`Symbol(${o})`}if(t=="function"){const o=e.name;return typeof o=="string"&&o.length>0?`Function(${o})`:"Function"}if(Array.isArray(e)){const o=e.length;let i="[";o>0&&(i+=q(e[0]));for(let c=1;c<o;c++)i+=", "+q(e[c]);return i+="]",i}const n=/\[object ([^\]]+)\]/.exec(toString.call(e));let r;if(n&&n.length>1)r=n[1];else return toString.call(e);if(r=="Object")try{return"Object("+JSON.stringify(e)+")"}catch{return"Object"}return e instanceof Error?`${e.name}: ${e.message} | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[correctness]
The function g uses a try-catch block to handle errors, but it rethrows the error using a custom mechanism (_.__wbindgen_exn_store). Ensure that this error handling mechanism is well-documented and that the errors are logged or handled appropriately elsewhere in the application.
| @@ -1 +1 @@ | |||
| export * from "./index" No newline at end of file | |||
| export * from "./default" No newline at end of file | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[❗❗ correctness]
Changing the export source from ./index to ./default could impact the module's API if ./default does not export the same members as ./index. Ensure that all necessary exports are still available and that this change does not break any dependent code.
| skip | ||
| } = require('./runtime/index-browser.js') | ||
| createParam, | ||
| } = require('./runtime/wasm-engine-edge.js') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[❗❗ correctness]
The import path for the runtime has changed to ./runtime/wasm-engine-edge.js. Ensure that this path is correct and that the necessary files are available in the deployment environment to avoid runtime errors.
| Debug.enable(typeof globalThis !== 'undefined' && globalThis['DEBUG'] || typeof process !== 'undefined' && process.env && process.env.DEBUG || undefined) | ||
| } | ||
|
|
||
| const PrismaClient = getPrismaClient(config) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[❗❗ correctness]
The PrismaClient is now being created using getPrismaClient(config). Verify that the config object is correctly structured and contains all necessary properties for the client to function properly, especially after the changes in the configuration structure.
| "inlineDatasources": { | ||
| "memberdb": { | ||
| "url": { | ||
| "fromEnvVar": "MEMBER_DB_URL", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[❗❗ security]
The MEMBER_DB_URL is being fetched from environment variables. Ensure that this environment variable is set in all environments where this code will run to prevent connection issues with the database.
| } | ||
| }) | ||
|
|
||
| if (typeof globalThis !== 'undefined' && globalThis['DEBUG'] || typeof process !== 'undefined' && process.env && process.env.DEBUG || undefined) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[❗❗ security]
The Debug feature is conditionally enabled based on the DEBUG environment variable. Ensure that this variable is appropriately set in production environments to avoid unintentional exposure of sensitive information.
No description provided.